package jsp;
import static org.junit.Assert.*;
import com.meterware.httpunit.*;
import java.io.File;
import junit.framework.TestCase;
import static org.junit.Assert.*;
/**@author Alberto Magni*/
public class WrongSSLServer extends TestCase
{
    public void testwrongSSL() throws Exception
    {   
        EMailSendingTest em= new EMailSendingTest();
        HttpUnitOptions.setScriptingEnabled(false);
        String url="http://localhost:8084/Jerry/";
        //setup
        WebConversation conversation= new WebConversation();
        WebResponse response=em.setUp(url,conversation,true,false,"test/files/addresses.csv");
        WebForm sendform=response.getForms()[0];
        sendform.setParameter("subject", "HTTPUNIT MESSAGE TEST");
        sendform.setParameter("fileoftext", new File("test/files/test.txt"));
        sendform.setParameter("password", "HariSeldon");
        response=sendform.submit();        
        assertEquals("Recipients", response.getTitle());
        System.out.println("Entered in: " +response.getTitle());
        WebForm sendformbutton=response.getForms()[0];
        sendformbutton.getButtons()[0].click();
        response=conversation.getCurrentPage();
        assertEquals("Error", response.getTitle());
        System.out.println("Entered in: " +response.getTitle());
        System.out.println("An error occoured.");
    }
}